import axios from 'axios'

// 创建axios实例
const service = axios.create({
    baseURL: '/dev-api',
  timeout: 25000
})

service.interceptors.request.use(
  config => {
    config.headers['Authorization'] = "Bearer A098XJN-HD5M55E-JQ0JJK7-MYYT62F"
    return config
  },
  error => {
    return Promise.reject(error)
  }
)
// 响应拦截器
service.interceptors.response.use(
  response => {
    return response.data
  },
  error => {
    console.error('API请求错误:', error)
    return Promise.reject(error)
  }
)

export default service
